import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int r = in.nextInt();
        int x = fibonacci(r);
        System.out.println( x % 10007 );

    }
    public static int fibonacci(Integer fn){
       if ( fn == 2 || fn ==1  ){
           return 1;
       }else{
           return fibonacci( fn -1) + fibonacci(fn -2);
        }
    }
}
